package org.ehe.finance.subject.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;
import org.ehe.finance.subject.domain.ErpFinanceAccountSubject;
import org.ehe.finance.subject.domain.bo.ErpFinanceAccountSubjectBo;
import org.ehe.finance.subject.domain.vo.ErpFinanceAccountSubjectTreeVo;
import org.ehe.finance.subject.domain.vo.ErpFinanceAccountSubjectVo;

import java.util.List;

/**
 * @author :zhangnn
 * @className :ErpFinanceAccountSubjectService
 * @description: TODO
 * @date 2025-08-22 09:47:06
 */
public interface ErpFinanceAccountSubjectService extends IService<ErpFinanceAccountSubject> {
    /**
     * 分页
     * @param bo
     * @param pageQuery
     * @return
     */
    TableDataInfo<ErpFinanceAccountSubjectVo> queryPageList(ErpFinanceAccountSubjectBo bo, PageQuery pageQuery);

    /**
     * 新增科目
     */
    boolean insertByBo(ErpFinanceAccountSubjectBo bo);

    /**
     * 修改科目
     */
    boolean updateByBo(ErpFinanceAccountSubjectBo bo);

    /**
     * 检查科目编码是否存在
     */
    boolean checkSubjectCodeUnique(String subjectCode, Long id);

    /**
     * 删除
     * @param id
     * @return
     */
    boolean deleteById(Long id);

    /**
     * TREE
     * @return
     */
    List<ErpFinanceAccountSubjectTreeVo> getAllSubjectTree();

    /**
     * 根据父级ID获取子科目树形结构
     * @param parentId
     * @return
     */
    List<ErpFinanceAccountSubjectTreeVo> getChildSubjectTree(Long parentId);
}
